#pragma once
#include "InternalsPlugin.hpp"
#include "Sprite.hpp"
#include "DriverInfo.hpp"
#include "TimingInfo.hpp"
#include "TypeDefs.hpp"

class WidgetCompare3Driver
{
public:
	WidgetCompare3Driver(const char *pRootPath, const char *pIniUIFilename, const char *pIniDriverMappingFilename, const char *pIniVehiculeClassMappingFilename);
	~WidgetCompare3Driver(void);

	void init(const ScreenInfoV01 &info, float ratio, float ratioWidth, float ratioHeight, Sprite spriteList[]);
	void updateData(const ScoringInfoV01 &info, DriverInfo orderedDriverInfos[], int viewedPlace, TimingInfoPerCategoryMap & timingInfoPerCategoryMap);
	void render(int profileIndex, const ScreenInfoV01 &info, const LPD3DXFONT *fontList, const D3DCOLOR *colorList, Sprite spriteList[]);

	std::string WidgetCompare3Driver::getTimeAsString(double seconds, bool forceAllFields, bool padHighest, bool showMillis, bool showFullMillis);
//private:
  bool initialized;
 
 const char *rootPath;
  char iniUIFilename[800];
  const char *iniDriverMappingFilename;
  const char *iniVehiculeClassMappingFilename;

  int nbProfiles;
  PluginProfile profiles[10];

  RECT tmpRect;

    // tools
  char tmp[1000];

  // driver data
 bool available;

 ImageData bgImageData;
 long nbDrivers;
  int textColorForViewedDriver;	
  int textFontForViewedDriver;	

   // place text
  unsigned char mPlace[3];
  bool placeAvailable[3];
  TextData placeTextData[3];
  char mPlaceStr[3][4];
  int viewedPilotColorIndex;
  // driver number
  bool numberAvailable[3];
  TextData numberTextData[3];
  char mDriverNumStr[3][5];


  // category
  bool classAvailable[3];
  ImageData classImageData[3];
  TextData classTextData[3];
  char mClassStickerName[3][32];
  int classOriginalImageColorIndex[3];
  int classOriginalTextColorIndex[3];

  // class 
  bool classNameAvailable[3];
  TextData classNameTextData[3];
  char mClassName[3][32];

  // driver name
  bool driverNameAvailable[3];
  TextData driverNameTextData[3];
  char mDriverName[3][32];

  // best time
  bool bestAvailable[3];
  TextData bestTextData[3];
  char bestStr[3][20];

  // last time
  bool lastAvailable[3];
  TextData lastTextData[3];
  char lastStr[3][20];

};

